package com.pds.web.monitor.service.impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.pds.common.utils.DateUtils;
import com.pds.web.monitor.domain.PdsMonitorTaskStep;
import com.pds.web.monitor.mapper.PdsMonitorTaskStepMapper;
import com.pds.web.monitor.service.IPdsMonitorTaskStepService;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.Date;

@Service
public class PdsMonitorTaskStepServiceImpl extends ServiceImpl<PdsMonitorTaskStepMapper, PdsMonitorTaskStep> implements IPdsMonitorTaskStepService {

    @Resource
    private PdsMonitorTaskStepMapper pdsMonitorTaskStepMapper;

    @Override
    public Boolean updateTaskStep(PdsMonitorTaskStep pdsMonitorTaskStep) {
        Date date = DateUtils.parseDate(DateUtils.getTime());
        pdsMonitorTaskStep.setUpdateTime(date);
        return pdsMonitorTaskStepMapper.updateTaskStep(pdsMonitorTaskStep) > 0;
    }

    @Override
    public Boolean deleteTaskStep(Long id) {
        return pdsMonitorTaskStepMapper.deleteTaskStep(id) > 0;
    }
}
